#ifndef __MMESH_OBJECT_H__
#define __MMESH_OBJECT_H__

#include "MSceneNode.h"
#include "VertexST.h"
#include <utility>
#include "MTriangle.h"
#include "MMesh.h"

class CMSceneManager;


class CMMeshObject : public CMSceneNode
{

public:
	
	CMMeshObject(const std::string& strName , MeshPtr& pMesh , CMSceneManager* pCreator );
	virtual ~CMMeshObject(void);

	virtual bool Update(float fElapsedTime);
	virtual bool Render(IRenderSystem* pRenderingEngine);
	virtual std::pair< bool , float > IntersectLine(vec3& vPos,vec3& vDir);

	MaterialPtr GetMaterial( void ) const;

	virtual void FindVisibleObjects(CMCamera* pCamera,CMRenderQueue* pQueue,bool bIncludeChildren);
	virtual void GetRenderOperation( CMRenderOperation* pRenderOp );
			
protected:

	MeshPtr                            m_pMesh;
	std::list<CMTriangle>              m_CollisionTriangle;

};

#endif